package main

import (
	"fmt"
	"time"
)

//封装的思想 一个方法只做一件事
func main() {

	ch3 := make(chan int)
	go writeOnly(ch3)
	go readOnly(ch3)
	time.Sleep(time.Second * 3)

}
func writeOnly(ch chan<- int) {
	ch <- 100
}
func readOnly(ch <-chan int) {
	data := <-ch
	fmt.Println(data)
}
